package com.piece.mall.api.dto;

import com.piece.core.elasticsearch.annotations.Document;
import com.piece.core.elasticsearch.annotations.Field;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.List;

@Data
@NoArgsConstructor
@ApiModel(value = "商品sku ES数据")
@Document(indexName = "mall_sku_info")
public class SkuEsDTO {

    @Field
    @ApiModelProperty(value = "skuId")
    private Long skuId;

    @Field
    @ApiModelProperty(value = "spuId")
    private Long spuId;

    @Field
    @ApiModelProperty(value = "品牌Id")
    private Long brandId;

    @Field
    @ApiModelProperty(value = "品牌名称")
    private String brandName;

    @Field
    @ApiModelProperty(value = "品牌logo")
    private String brandImg;

    @Field
    @ApiModelProperty(value = "分类Id")
    private Long catalogId;

    @Field
    @ApiModelProperty(value = "分类名称")
    private String catalogName;

    @Field
    @ApiModelProperty(value = "标题")
    private String skuTitle;

    @Field
    @ApiModelProperty(value = "价格")
    private BigDecimal price;

    @Field
    @ApiModelProperty(value = "商品图片")
    private String skuDefaultImg;

    @Field
    @ApiModelProperty(value = "销售数量")
    private Long saleCount;

    @Field
    @ApiModelProperty(value = "是否有库存")
    private Boolean hasStock;

    @Field
    @ApiModelProperty(value = "属性集合")
    private List<Attrs> attrs;

    @Data
    public static class Attrs {
        private Long attrId;
        private String attrName;
        private String attrValue;
    }
}
